<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 18.要求用户输入行数和列数生成表格，例如用户输入2行3列，生成的表格代码如下：
<table>
	<tr>
		<td>1行1列</td>
		<td>1行2列</td>
		<td>1行3列</td>
	</tr>
	<tr>
		<td>2行1列</td>
		<td>2行2列</td>
		<td>2行3列</td>
	</tr> -->
    </table>
</body>
<script>
    var row = prompt('请输入行数'), col = prompt(`请输入列数`)
    console.log(`<table>`);
    for (var i = 1; i <= row; i++) {
        console.log('<tr>');
        for (var j =1;j<=col;j++){
            console.log(`<td>${i}行${j}列</td>`);
        }
        console.log('</tr>');
    }

    console.log(`</table>`);
</script>

</html>